1)  [URL=http://www.roboforum.ru/viewtopic.php?f=2&t=1070&p=11560#p11560]      AVR  CVAVR    VMLAB.[/URL]  6  .  

2)  CVAVR  VMLAB    C:\CVAVR    C:\VMLAB   -     -  7   !

3)        "SERVO"       :    C:\SERVO
       "_ReadMe For code testing and USART.txt"     .prj

4)  VMLAB     -  vmlab.prj -    "" - " " -    .      : " ", "", ". "

5)  3   -   .  .       .

6)      vmlab.prj    

.plot V(PC0) V(PC1) V(PC2) V(PC3) V(PC4) V(PC5) V(PC6) V(PC7) V(PD1)

 :

.plot V(PC1)

      PC1 -   .

7)  CVAVR   - cv.prj -         


 1500   (  )

while (1) {            //     

 -    2100   (   )   -20 .

 -    900     20 .

     .

   "1"

    

   "0"

 18 

}


8)    #include <delay.h>     

char servo_pulse = 150;   //      SERVO - (150 * 10)  

char servo_cw = 1;       
// "1" servo   ,  "0"    -   
char ctr; //  - .

9)  putsf("Hello world");      putsf("Servo ramping");


10)    :

while(1){ 
           
//    SERVO

if (servo_pulse > 210) { //   2100 
    servo_cw = 0;        //   
                       } 
                       
if (servo_pulse < 90) { //   900 
    servo_cw = 1;       //   
                       }                      

//    

if (servo_cw == 0) { //   
    servo_pulse --;  //     10 
                   } 

if (servo_cw == 1) { //   
    servo_pulse ++;  //     10 
                   } 

//    

ctr = servo_pulse; 

putchar(ctr); //        

PORTC.1 = 1;  //    . "1"

while (ctr) { //  
   ctr --;
   delay_us(10); //  10 
             }
PORTC.1 = 0;  //    . "0"

// delay_ms(17); //      17 
delay_ms(1); //     1  

         }


11)    "  "  -  .

12)   VMLAB     -  vmlab.prj -    "" - " " -    .     SCOPE   1    2 mS.  

13) 3     -       "Servo ramping"      SCOPE      -  .   TTY   " "   "Numeric (decimel)".

14)         .


 PROTEUS           . 
   - http://oProteus.narod.ru

=========

 - http://www.roboforum.ru/viewtopic.php?f=2&t=3958